bitkeeper revision 1.1071.1.7 (40f54af55pyLX7mn-IvUDb5re5ebeA)
authoriap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk>
Wed, 14 Jul 2004 15:02:13 +0000 (15:02 +0000)
committeriap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk>
Wed, 14 Jul 2004 15:02:13 +0000 (15:02 +0000)
In linux, make halt the same as poweroff.
Xen now observes dom 0 exit code and halts if required.

linux-2.4.26-xen-sparse/arch/xen/kernel/process.c
xen/arch/x86/domain.c
xen/common/domain.c

index 6d805057439041d5b517f3a35923f972c37cf30b..56cabca2a9483c37ffd3c91ddc4c198b582d70db 100644 (file)
@@ -125,14 +125,7 @@ void machine_restart(char *__unused)
 
 void machine_halt(void)
 {
-    /* We really want to get pending console data out before we die. */
-    extern void xencons_force_flush(void);
-    xencons_force_flush();
-    for ( ; ; ) /* loop without wasting cpu cycles */
-    {
-        HYPERVISOR_shared_info->vcpu_data[0].evtchn_upcall_pending = 0;
-        HYPERVISOR_block();
-    }
+    machine_power_off();
 }
 
 void machine_power_off(void)
index 83eea289aa2232b2d435b675536031fe136e9407..b07d44d6772a1bbc4ccff3240fe0ed9ae499522a 100644 (file)
@@ -199,12 +199,7 @@ void machine_restart(char * __unused)
 
 void machine_halt(void)
 {
-    machine_restart(0);
-}
-
-void machine_power_off(void)
-{
-    machine_restart(0);
+    while(1){ safe_halt(); }
 }
 
 void arch_do_createdomain(struct domain *d)
index a2b83768cdb776475d0b02402d8e12825f863c4e..7082f07bed3de75dfb82d96ab5523d5d451336ff 100644 (file)
@@ -170,8 +170,18 @@ void domain_shutdown(u8 reason)
     if ( current->domain == 0 )
     {
         extern void machine_restart(char *);
-        printk("Domain 0 shutdown: rebooting machine!\n");
-        machine_restart(0);
+        extern void machine_halt(void);
+
+        if ( reason == 0 ) 
+        {
+            printk("Domain 0 halted: Our work here is done.\n");
+            machine_halt();
+        }
+        else
+        {
+            printk("Domain 0 shutdown: rebooting machine!\n");
+            machine_restart(0);
+        }
     }
 
     current->shutdown_code = reason;